Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds focused parser coverage for the noun-first remove entrypoints introduced by the recent bucket/object command-group work.
The command-group PR added help-contract coverage and a few parser assertions around
bucket cors, but theremovepaths still had no direct parser tests. That left a small regression window where clap wiring forrc bucket removeorrc object removecould drift without a fast unit test catching it.User impact
Users now have explicit regression coverage for two public noun-first removal entrypoints:
rc bucket remove local/my-bucketrc object remove local/my-bucket/report.csv --dry-runIf either path stops parsing correctly in the future, the unit suite will fail immediately instead of relying on broader help output or runtime behavior to detect the breakage.
Root cause
The noun-first command groups were added in #76, but parser tests in
crates/cli/src/commands/mod.rsonly exercisedbucket corsrouting. The remove subcommands delegated into existing argument types without any direct assertion that their positional arguments and flags survived clap parsing.Fix
This PR adds two narrow parser tests in
crates/cli/src/commands/mod.rs:rc bucket removereachesbucket::BucketCommands::Removewith the expected target;rc object removereachesobject::ObjectCommands::Remove, preserves the path list, and keeps--dry-runenabled.The scope stays limited to the recently changed noun-first command surface and does not modify production code.
Validation
I ran the following successfully:
cargo test -p rustfs-cli cli_accepts_bucket_remove_subcommand --lib -- --nocapturecargo test -p rustfs-cli cli_accepts_object_remove_subcommand --lib -- --nocapturecargo fmt --all --checkcargo clippy --workspace -- -D warningscargo test --workspaceI also ran
make pre-commitper the automation instructions, but this checkout does not define that target and exits with: